package com.medishare.adapter;

import java.util.ArrayList;

import com.loopj.android.http.AsyncHttpClient;
import com.loopj.android.http.AsyncHttpResponseHandler;
import com.medishare.R;
import com.medishare.data.DataCallRecord;
import com.medishare.data.DataMediReminder;
import com.medishare.data.DataMember;
import com.medishare.util.Utils;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

public class AdapterCallAssistant extends BaseAdapter {
	private Context mContext;
	private ArrayList<DataMember> mData;
	private LayoutInflater mInflater;
    public AdapterCallAssistant(Context context,ArrayList<DataMember> datas){
    	this.mContext = context;
    	this.mData = datas;
    	mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    }
	@Override
	public int getCount() {
		return mData.size();
	}

	@Override
	public DataMember getItem(int position) {
		return mData.get(position);
	}

	@Override
	public long getItemId(int position) {
		return 0;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		ViewHolder holder;
		DataMember data = mData.get(position);
		if(convertView == null){
			convertView = mInflater.inflate(R.layout.gridview_call_assistant, null);
			holder = new ViewHolder();
			holder.name = (TextView) convertView.findViewById(R.id.button);
			convertView.setTag(holder);
		}else{
			holder = (ViewHolder) convertView.getTag();
		}
		holder.name.setText(data.getName());
		return convertView;
	}
    
	
	static class ViewHolder{
		public TextView name;
	}
	
	
	
}
